<script setup>
definePageMeta({
  layout: "login",
});
const router = useRouter();
const userName = ref("");
const password = ref("");
const goLogin = () => {
  const token = useCookie("token");
  token.value = userName.value;
  router.push("/");
};
</script>
<template>
  <Container top="0">
    <div
      class="space-y-[30px] login-box flex flex-col justify-center items-center rounded-[20px] overflow-hidden absolute w-[400px] h-[400px] left-[50%] translate-x-[200px] bg-[#fff] top-[50%] translate-y-[-200px]"
    >
      <div class="font-bold">用户登录</div>
      <UInput
        size="md"
        class="w-[300px]"
        type="text"
        v-model="userName"
        placeholder="请输入用户名或手机号"
      ></UInput>
      <UInput
        size="md"
        class="w-[300px]"
        type="password"
        v-model="password"
        placeholder="请输入密码"
      ></UInput>
      <UButton
        label="登录"
        @click="goLogin"
        block
        :disabled="!userName || !password"
        class="w-[300px] h-[40px]"
      ></UButton>
    </div>
  </Container>
</template>
<style scoped lang="scss"></style>
